package com.tangpian.framework.service.task;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tangpian.framework.entity.Task;
import com.tangpian.framework.repository.TaskDao;

@Service
@Transactional(readOnly = true)
public class TaskService {

	@Autowired
	private TaskDao taskDao;

	@Transactional(readOnly = false)
	public void createTask(Task task) {
		taskDao.save(task);
	}

	public List<Task> listAllTask() {
		return (List<Task>) taskDao.findAll();
	}

	public Task getTask(String id) {
		return taskDao.findOne(id);
	}
}
